package com.cskaoyan.mapper;

import com.cskaoyan.bean.MallAdmin;
import com.cskaoyan.bean.MallAdminExample;
import com.cskaoyan.model.bo.profile.PasswordBo;
import com.cskaoyan.model.vo.system.SimpleMallAdmin;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MallAdminMapper {

    long countByExample(MallAdminExample example);

    int deleteByExample(MallAdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MallAdmin record);

    int insertSelective(MallAdmin record);

    List<MallAdmin> selectByExample(MallAdminExample example);

    List<SimpleMallAdmin> selectSimpleByExample(MallAdminExample example);


    MallAdmin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MallAdmin record, @Param("example") MallAdminExample example);

    int updateByExample(@Param("record") MallAdmin record, @Param("example") MallAdminExample example);

    int updateByPrimaryKeySelective(MallAdmin record);

    int updateByPrimaryKey(MallAdmin record);

    /**
     * 新增管理员
     *
     * @param admin
     * @return
     */
    Integer insertSimpleAdmin(@Param("admin") MallAdmin admin);

    /**
     * 更新管理员账号
     *
     * @param admin
     * @return
     */

    Integer updateAdminById(@Param("admin") MallAdmin admin);

    Integer selectByUsername(@Param("username") String username);

    String selectPasswordByUsername(@Param("username") String username);

    Integer[] selectRoleIdsByUsername(@Param("username") String username);

    Integer updatePasswordByUsername(@Param("bo") PasswordBo bo, @Param("username") String username);

    List<MallAdmin> selectAll();

}
